package com.ruoyi.system.service.vantservice.financialSupport.impl;

import com.ruoyi.system.domain.zhuangxiumain.financialSupport.CooperativeBrand;
import com.ruoyi.system.mapper.vant.financialSupport.ApiCooperativeBrandMapper;
import com.ruoyi.system.service.vantservice.financialSupport.ApiCooperativeBrandService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 惠普 on 2021/1/9 17:17
 */
@Service("apiCooperativeBrandService")
public class ApiCooperativeBrandServiceImpl implements ApiCooperativeBrandService {
    @Resource
    private ApiCooperativeBrandMapper apiCooperativeBrandMapper;

    /**
     * 查询合作伙伴全部
     * @return
     */
    @Override
    public List<CooperativeBrand> selectCooperativeBrandByNull() {
        return apiCooperativeBrandMapper.selectCooperativeBrandByNull();
    }

    /**
     * 添加合作伙伴
     * @param cooperativeBrand
     * @return
     */
    @Override
    public int addCooperativeBrand(CooperativeBrand cooperativeBrand) {
        int row = 0;
        row = apiCooperativeBrandMapper.addCooperativeBrand(cooperativeBrand);
        return row;
    }

    /**
     * 修改合作伙伴
     * @param cooperativeBrand
     * @return
     */
    @Override
    public int updateCooperativeBrand(CooperativeBrand cooperativeBrand) {
        int row = 0;
        row = apiCooperativeBrandMapper.updateCooperativeBrand(cooperativeBrand);
        return row;
    }

    /**
     * 删除合作伙伴
     * @param cooperativeId
     * @return
     */
    @Override
    public int deleteCooperativeBrand(Integer[] cooperativeId) {
        int row = 0;
        row = apiCooperativeBrandMapper.deleteCooperativeBrand(cooperativeId);
        return row;
    }

    @Override
    public int updateState(Integer id, String state) {
        return  apiCooperativeBrandMapper.updateState(id,state);
    }

    @Override
    public List<CooperativeBrand> getCooperativeByState() {
        return apiCooperativeBrandMapper.getCooperativeByState();
    }

}
